import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import uView from '@/uni_modules/uview-ui'
import store from '@/store/index.js'
import init from "@/common/init.js"
Vue.config.productionTip = false
App.mpType = 'app'

Vue.use(uView);

Vue.mixin({
	methods:{
		navTo(url){
			uni.navigateTo({
				url:url
			})
		}
	}
})

const app = new Vue({
	...App,
	store
})

init().then(res => {
	app.$mount()
	if (res == 1) {
		uni.showToast({
			title: '请先登录',
			icon:'none'
		})
		setTimeout(() => {
			uni.hideToast()
			uni.navigateTo({
				url: '/pages/login/login'
			})
		}, 1000)
	}
})





// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	return {
		app
	}
}
// #endif
